home page
ehasktags - hasktags enhanced
Some really simple things can be so useful!
The Glasgow Haskell Compiler (GHC) comes along with a progam called hasktags that reads through Haskell programs and generates tags files. The tags file can be used with editors like vi, TextPad to help you jump directly to function definitions, data definitions etc. It is really neat.
What is the e for
Nothing much really. I modified the hasktags source code to contain the following changes:
- Add support for finding class definitions
- Add support to recursively walk directory tree and tag all the .hs and .lhs files in it.
- Add a usage message to tell the user about the command line options
- Removed creation of tags in emacs format (only vi format)
Limitations
There are still some limitations that I'd like to fix.
- Works only on Windows because I assume that the path delimiter is '\\'. It is a simple matter for you to make it '/' and use it for unixes. (Haven't checked, but should work).
- Tags are not in sorted order. This limitation exists with hasktags too. I get around this by setting the ignorecase option in vi so that it does a linear search instead of a binary search for tags (and in prefer a case insensitive search anyway).
Download
Here's the Haskell source ehasktags.hs . (I have renamed it to a .txt because my web host won't allow you to see .hs files).
I build this file using the command:
ghc ehasktags.hs -o ehasktags.exe